﻿<%@ Page Title="" Language="C#" MasterPageFile="~/UI/HRManagerUI/HrManager.Master" AutoEventWireup="true" CodeBehind="AddProject.aspx.cs" Inherits="HRM.UI.HRManagerUI.Configuration.AddProject" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="mainContentBody" runat="server">
    <link href="../../../Styles/Employee/AddEmployeeCss.css" rel="stylesheet" type="text/css" />
      <link href="../../../Scripts/htmlDatePicker.css" rel="stylesheet" type="text/css" />
    <script src="../../../Scripts/htmlDatePicker.js" type="text/javascript"></script>
    <link href="../../../Styles/Configuration/AddEmployeeCss.css" rel="stylesheet" type="text/css" />
    <link href="../../../Styles/Configuration/AddProjectCss.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" language="javascript">

        function CheckField() {
            if (document.getElementById("<%=txtProjectName.ClientID%>").value == "") {
                document.getElementById("<%=msgLabel.ClientID%>").textContent = "Please Enter Employee Project Name!";
                document.getElementById("<%=msgLabel.ClientID%>").style.color = "red";
                document.getElementById("<%=txtProjectName.ClientID%>").focus();
                return false;
            }
            if (document.getElementById("<%=txtStartingdate.ClientID%>").Value == "") {
                document.getElementById("<%=msgLabel.ClientID%>").textContent = "Please Enter Starting Date!";
                document.getElementById("<%=msgLabel.ClientID%>").style.color = "red";
                document.getElementById("<%=txtStartingdate.ClientID%>").focus();
                return false;
            }
            if (document.getElementById("<%=txtClosingdate.ClientID%>").Value == "") {
                document.getElementById("<%=msgLabel.ClientID%>").textContent = "Please Enter Closing Date!";
                document.getElementById("<%=msgLabel.ClientID%>").style.color = "red";
                document.getElementById("<%=txtClosingdate.ClientID%>").focus();
                return false;
            }
            return true;
        }
    </script>
    <fieldset>
        <legend>Employee Contact Info</legend>
        <table class="AddProjectTB">
            <tr>
                <td colspan="2" class="msgLabeltd">
                    <asp:Label runat="server" ID="msgLabel"></asp:Label>
                </td>
            </tr>
            <tr>
                <td class="Label">
                    Project Name
                </td>
                <td class="Field">
                    <input type="text" runat="server" id="txtProjectName" class="textboxinput" /><span
                        class="estaricStar">*</span>
                </td>
            </tr>
            <tr>
                <td class="Label">
                    Starting Date
                </td>
                <td class="Field">
                    <input type="text" runat="server" id="txtStartingdate" class="textboxinput" readonly
                        onclick="GetDate(this);" /><span class="estaricStar">*</span>
                </td>
            </tr>
            <tr>
                <td class="Label">
                    Closing date
                </td>
                <td class="Field">
                    <input type="text" runat="server" id="txtClosingdate" class="textboxinput" readonly
                        onclick="GetDate(this);" /><span class="estaricStar">*</span>
                </td>
            </tr>
            <tr>
                <td class="Label">
                    Total Employee
                </td>
                <td class="Field">
                    <input type="text" runat="server" id="txtEmployeeNumber" class="textboxinput" />
                </td>
            </tr>
            <tr>
                <td class="Label">
                    Project Location
                </td>
                <td class="Field">
                    <input type="text" runat="server" id="txtProjectLocation" class="textboxinput" />
                </td>
            </tr>
            <tr>
                <td class="Label">
                    Project description
                </td>
                <td class="Field">
                    <textarea runat="server" id="txtProjectdescription" cols="14" rows="2" class="inputTextarea"></textarea>
                </td>
            </tr>
            <tr>
                <td class="Label">
                </td>
                <td class="Field">
                    <input type="submit" onserverclick="SaveProject" runat="server" id="addPproject"
                        value="Save" class="btnCss" onclick="return CheckField()" />
                </td>
            </tr>
        </table>
    </fieldset>
    <fieldset>
        <legend>Project List</legend>
        <table class="ProjectseracTB">
            <tr>
                <td>
                </td>
                <td>
                </td>
            </tr>
        </table>
        <asp:GridView runat="server" ID="ProjectsGridview" AutoGenerateColumns="False" Width="79%"
            CssClass="GridviewStyle"  BorderColor="#999999" BorderWidth="1px"
            CellPadding="3" AllowPaging="True" OnPageIndexChanging="ProjectsGridview_PageIndexChanging"
            PageSize="3" BorderStyle="Solid" ForeColor="Black" GridLines="Vertical" OnRowCancelingEdit="ProjectsGridview_RowCancelingEdit"
            OnRowDeleting="ProjectsGridview_RowDeleting" OnRowEditing="ProjectsGridview_RowEditing"
            OnRowUpdating="ProjectsGridview_RowUpdating" Height="142px">
            <AlternatingRowStyle/>
            <Columns>
                <asp:TemplateField runat="server" Visible="False">
                    <ItemTemplate>
                        <asp:Label ID="lblId" runat="server" Text='<%# Bind("Id") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Project Name">
                    <EditItemTemplate>
                        <asp:TextBox ID="txtPName" runat="server" Text='<%# Bind("ProjectName") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("ProjectName") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Starting Date">
                    <EditItemTemplate>
                        <asp:TextBox ID="txtStartDate" runat="server" Text='<%# Bind("startingDate") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label2" runat="server" Text='<%# Bind("startingDate") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Closing Date">
                    <EditItemTemplate>
                        <asp:TextBox ID="txtCloseDate" runat="server" Text='<%# Bind("ClosingDate") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label3" runat="server" Text='<%# Bind("ClosingDate") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Total Employee">
                    <EditItemTemplate>
                        <asp:TextBox ID="txtxTotalEmp" runat="server" Text='<%# Bind("TotalEmployee") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label4" runat="server" Text='<%# Bind("TotalEmployee") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Project Location" SortExpression="Location">
                    <EditItemTemplate>
                        <asp:TextBox ID="txtProjectLocationgv" runat="server" Text='<%# Bind("Location") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label6" runat="server" Text='<%# Bind("Location") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Project Description">
                    <ItemTemplate>
                        <asp:Label ID="Label5" runat="server" Text='<%# Bind("ProjectDescription") %>'></asp:Label>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="txtDescription" runat="server" 
                            Text='<%# Bind("ProjectDescription") %>'></asp:TextBox>
                    </EditItemTemplate>
                </asp:TemplateField>
                <asp:CommandField HeaderText="Edit" ShowEditButton="True" />
                <asp:CommandField HeaderText="Delete" ShowDeleteButton="True" />
            </Columns>
            <FooterStyle CssClass="GridViewFooterStyle"/>
            <HeaderStyle CssClass="GridViewHeaderStyle" />
            <PagerStyle ForeColor="Black" HorizontalAlign="Center"  CssClass="GridViewFooterStyle"/>
            
        </asp:GridView>
    </fieldset>
</asp:Content>
